﻿using Microsoft.Xna.Framework;

namespace Asteroids.Entities.Components
{
    /// <summary>
    /// 
    /// </summary>
    public class TransformComponent : Component
    {
        private Vector2 _position;
        private float _rotation;

        public TransformComponent()
        {
            _position = Vector2.Zero;
            _rotation = 0;
        }

        public override void Reset()
        {
            _position = Vector2.Zero;
            _rotation = 0;
        }

        public Vector2 Location
        {
            get { return _position; }
            set { _position = value; }
        }

        public float Rotation
        {
            get { return _rotation; }
            set { _rotation = value; }
        }
    }

    public class PhysicsComponent : Component
    {
        private Vector2 _velocity;
        private Vector2 _acceleration;

        private float _rotationalVelocity;
        private float _rotationalAcceleration;

        public override void Reset()
        {
            _velocity = Vector2.Zero;
            _acceleration = Vector2.Zero;
            _rotationalVelocity = 0;
            _rotationalAcceleration = 0;
        }

        public Vector2 Velocity
        {
            get { return _velocity; }
            set { _velocity = value; }
        }

        public Vector2 Acceleration
        {
            get { return _acceleration; }
            set { _acceleration = value; }
        }

        public float RotationalVelocity
        {
            get { return _rotationalVelocity; }
            set { _rotationalVelocity = value; }
        }

        public float RotationalAcceleration
        {
            get { return _rotationalAcceleration; }
            set { _rotationalAcceleration = value; }
        }
    }
}
